
/**
 * @brief    Defines scale (area) factors for static and dynamic loads. In
 * dynamic analysis, DAREA is used in conjunction with RLOADi and TLOADi
 * entries.
 *
 * @version  0.1
 * @author   wuxingchuang
 * @date     2024.11.21
 *          _
 *      ___| |__   ___ _ __   __ _  ___  _ __   __ _
 *     / __| '_ \ / _ \ '_ \ / _` |/ _ \| '_ \ / _` |
 *     \__ \ | | |  __/ | | | (_| | (_) | | | | (_| |
 *     |___/_| |_|\___|_| |_|\__, |\___/|_| |_|\__, |
 *                           |___/             |___/
 * @copyright (c) 2024 by 神工仿真, All Rights Reserved.
 */
#pragma once
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Common/SetBase.h"
#include "DataStructure/Input/Load/LoadTypes.h"
#include "DataStructure/Input/Solver/DOFDirections.h"
SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN

struct DAREAData : public SetBase
{
    SG::DataStructure::FEM::DOFDirections GetDirection () const;

    SG::DataStructure::Common::I64  m_P        = 0;    ///<
    SG::DataStructure::Common::I64  m_C        = 0;    ///<
    SG::DataStructure::Common::Real m_A        = 0.0;  ///<
    SG::DataStructure::Common::Id   m_domainId = 0;    ///<
    static SG::DataStructure::FEM::LoadType GetType ()
    {
        return SG::DataStructure::FEM::LoadType::LOAD_DAREA;
    };
};

inline SG::DataStructure::FEM::DOFDirections DAREAData::GetDirection () const
{
    switch (m_C)
    {
    case 1:
        return SG::DataStructure::FEM::DOF_Ux;
    case 2:
        return SG::DataStructure::FEM::DOF_Uy;
    case 3:
        return SG::DataStructure::FEM::DOF_Uz;
    case 4:
        return SG::DataStructure::FEM::DOF_Rotx;
    case 5:
        return SG::DataStructure::FEM::DOF_Roty;
    case 6:
        return SG::DataStructure::FEM::DOF_Rotz;
    default:
        return SG::DataStructure::FEM::DOF_Unknow;
    }
}

///< @brief 判断数据是否相等
DECLSPEC bool operator== (const DAREAData& val1, const DAREAData& val2);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE
